package com.yunkeji.api.moments.mapper;

import com.yunkeji.dao.mapper.MomentsReplyMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

public interface ApiMomentsReplyMapper extends MomentsReplyMapper {

    /**
     * 增加动态点赞数量
     *
     * @author 老张
     * @param id
     */
    @Update("UPDATE ykj_moments_reply SET like_num = like_num+1 WHERE id =#{id}")
    void addLikes(@Param("id") Long id);

    /**
     * 减少动态点赞数量
     *
     * @author 老张
     * @param id
     */
    @Update("UPDATE ykj_moments_reply SET like_num = like_num-1 WHERE id =#{id")
    void subLikes(@Param("id") Long id);

    /**
     * 增加回复点赞数量
     *
     * @author 老张
     * @param id
     */
    @Update("UPDATE ykj_moments_reply SET reply_num = like_num+1 WHERE id =#{id}")
    void addReply(@Param("id") Long id);

    /**
     * 减少回复点赞数量
     *
     * @author 老张
     * @param id
     */
    @Update("UPDATE ykj_moments_reply SET reply_num = like_num-1 WHERE id =#{id")
    void subReply(@Param("id") Long id);
}
